package cn.com.chengmandian.bike.service;

import cn.com.chengmandian.bike.dto.MemberLocationDisptachForm;
import cn.com.chengmandian.bike.dto.MemberLocationForm;
import cn.com.chengmandian.bike.dto.RideOrderDto;
import cn.com.chengmandian.bike.dto.RideOrderForm;
import cn.com.chengmandian.bike.model.*;
import cn.com.chengmandian.bike.model.vo.*;
import cn.com.chengmandian.core.web.pojo.AgentUser;
import cn.com.chengmandian.service.bike.form.RideRefundForm;
import cn.com.chengmandian.service.bike.form.RideSysUpdateMoneyForm;
import cn.com.chengmandian.service.bike.form.SysCloseOrderForm;
import cn.com.chengmandian.service.bike.form.SysStopOrderForm;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 电单车运营-骑行订单 服务类
 * </p>
 *
 * @author AutoGenerator
 * @since 2021-12-10
 */
public interface IEbRideOrderService extends IService<EbRideOrder> {

    EbRideOrder getRideConfirmOrder(Integer memberId);

    EbRideOrder addOrder(EbDeviceBike deviceBike, MemberLocationForm memberLocationForm, AgentUser agentUser);

    void failBikeInitOrder(Integer bikeId, Integer memberId);

    void failInitOrder(Integer orderId);

    EbRideOrder getByNo(String orderNo, Integer memberId);

    void openLock(String orderNo, Integer memberId);

    void sysStopLock(SysStopOrderForm sysStopOrderForm);

    void memberStopLock(String orderNo, Integer memberId, Integer sendStopCommand);

    void stopLock(EbRideOrder rideOrder, boolean allowNoparking, Integer userType, Integer userId, String userName, Integer sendStopCommand);

    void agentCloseLock(Integer orderId, BigDecimal customMoney, Integer opsUserId, String userName);

    void sysCloseLock(SysCloseOrderForm sysCloseOrderForm);

    void opsCloseLock(Integer orderId, Integer closeReason, Integer opsUserId, String userName, BigDecimal customMoney);

    void memberCloseLock(String orderNo, Integer memberId, MemberLocationDisptachForm memberLocationForm);

    RidingVo riding(Integer memberId);

    RideOrderCountVo getOrderCount(EbRideOrder rideOrder, Date closeTime, boolean allowCoupon, Boolean isClose);

    RideOrderCountVo getOrderCount(EbRideOrder rideOrder, Date closeTime, boolean allowCoupon, MemberCardVo appointMemberCard, MemberCouponVo appointMemberCoupon, Boolean isClose);

    IPage<RideOrderVo> pages(RideOrderDto rideOrderDto);

    RideOrderVo detail(String orderNo, Integer memberId);

    EbRideOrder getFirstStationDispatch(Integer memberId, Integer areaId);

    void memberOrderEvaluateData(RideOrderForm rideOrderForm);

    void cancelOrderSettleForClose(Integer orderId);

    void orderSettleForClose(EbRideOrder rideOrder, BigDecimal customMoney, Integer userType);

    /**
     * 订单车辆归还
     * @param orderId
     * @param payFirstMode
     */
    void orderBikeReturn(Integer orderId, boolean payFirstMode, Integer closeUserType);

    /**
     * 待支付自动支付
     * @param orderId
     */
    void confirmAutoPay(Integer orderId, Integer userType);

    boolean autoPay(EbRideOrder rideOrder, Integer userType);

    void freeOrderAutoPay(EbRideOrder rideOrder, Integer userType);

    /**
     * 订单已支付
     */
    void orderPaid(Integer orderId, BigDecimal payChargeMoney, BigDecimal payGiftMoney, Integer userType);

    /**
     * 订单罚款已缴纳
     */
    void orderPenaltyPaid(Integer orderId);

    EbRideOrder getUserConfirmOrder(Integer memberId);

    void openHelmet(String orderNo, Integer id);

    EbRideOrder getByBike(Integer bikeId);

    /**
     * 获取 指定时长 还未支付订单
     */
    List<EbRideOrder> listUnPayOrder(int seconds);

    void rideRefund(RideRefundForm form);

    void rideRefundSuccess(EbRefundInfo ebRefundInfo);

    void updateOrderRiding(Integer orderId, RideOrderCountVo rideOrderCountVo);

    void memberCheckStop(String orderNo, Integer aiPhotosPass, Integer memberId);

    void orderUpdateMoney(AgentUser agentUser, EbRideOrder ebRideOrder, RideSysUpdateMoneyForm form);

    void bikeCloseOrder(Integer bikeId);

    List<RideOrderUseCardFeeVo> rideUseCard(String orderNo, Integer memberId);

    void orderConsumeMemberCard(Integer rideOrderId, Integer memberCardId, Integer userType);

    GetCloseResultVo getCloseResult(String orderNo, Integer memberId, Integer userType);

    EbRideOrder getNoUseCardWaitPayOrder(Integer memberId);

    void memberOrderBell(String orderNo, Integer memberId);

    void memberAiPhotosStop(MultipartFile file, Integer isDispatch, String orderNo, Integer memberId);

    RideOrderStopTimesVo orderStopTimes(String orderNo, Integer memberId);
}
